//
//  LocalNotificationExampleAppDelegate.m
//  LocalNotificationExample
//

#import "LocalNotificationExampleAppDelegate.h"
#import "LocalNotificationExampleViewController.h"

@implementation LocalNotificationExampleAppDelegate

@synthesize window;
@synthesize viewController;


#pragma mark -
#pragma mark Application lifecycle

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    
    // Override point for customization after application launch.
	UILocalNotification *note = [launchOptions
								 objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
	if (note)
		NSLog(@"Notification info: %@", note.userInfo);
	
    // Add the view controller's view to the window and display.
    [self.window addSubview:viewController.view];
    [self.window makeKeyAndVisible];

    return YES;
}


- (void)applicationDidBecomeActive:(UIApplication *)application {
	application.applicationIconBadgeNumber = 0;
}

- (void)application:(UIApplication *)application
didReceiveLocalNotification:(UILocalNotification *)notification {
	NSLog(@"Notification info: %@", notification.userInfo);
}

#pragma mark -
#pragma mark Memory management

- (void)dealloc {
    [viewController release];
    [window release];
    [super dealloc];
}

@end
